package com.base.demo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * ClassName: demo01
 * PackageName: com.cwy.demo
 * Describe:
 *
 * @author: Cheng Wenying
 * @Create: 2023/11/20
 * @version:
 */
public class demo01 {
    public static void main(String[] args) {
        System.out.println("hello world!");
//        int total = 0;
//        Integer sum = 20;
//        System.out.println(Math.max(total, sum));
        List<String> list = new ArrayList<>();
        list.add("hello world!");
        list.add("aaaa");
        list.add("nihao");
        String s = "aaaa,nihao";
//        String[] split = s.split(",");
//        List<String> strings = Arrays.asList(split);
//
//        HashSet<Object> objects = new HashSet<>(strings);
//        System.out.println(objects);
        list = list.stream().filter(item -> Arrays.asList(s.split(",")).contains(item)).collect(Collectors.toList());
        System.out.println(list);
        List<String> list1 = new ArrayList<>();
        list1.add("");
        System.out.println(list1.isEmpty());
        System.out.println(list1.size());

    }
}
